<template>
  <div class="store_info_page">
    <p v-for="(item,index) in storeInfo" :key="index">
      <span>{{ item.name }}</span>
      <span>{{ item.value }}</span>
    </p>
  </div>
</template>

<script>
// import { businessListGetById } from '@/api/business'
export default {
  props: {
    dialog: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      storeInfo: [
        { name: '店铺名称', value: '', field: 'shopName' },
        { name: '合同有效期至', value: '', field: 'effectiveTime' },
        { name: '负责人', value: '', field: 'chargePersonName' },
        { name: '联系电话', value: '', field: 'chargePersonPhone' },
        { name: '联系地址', value: '', field: 'shopAdress' }
      ]
    }
  },
  created() {
    console.log(this.dialog)
    this.getOrderInfo(this.dialog)
  },
  methods: {
    getOrderInfo(o) {
      this.storeInfo.map(item => {
        item.value = o[item.field] || ''
      })
    }
  }
  // computed: {
  //   query() {
  //     return this.$route.query
  //   }
  // },
  // created() {
  //   this.getDetails()
  // },
  // methods: {
  //   async getDetails() {
  //     console.log(this.query)
  //     const res = await businessListGetById({ shopId:this.query.info.shopId})
  //     if (res.code === '') {
  //       this.storeDetails = res.data
  //       const o = res.data
  //       this.getStoreInfo(o)
  //     }
  //   },
  //  getStoreInfo(o) {
  //     this.storeInfo.map(item => {
  //       item.value = o[item.field] || ''
  //     })
  //   },
  // }
}
</script>

<style lang='less' scoped>
.store_info_page {
  padding: 20px 10%;
  overflow: hidden;
  p {
    width: 50%;
    float: left;
    margin-bottom: 20px;
    span {
      font-size: 16px;
      color: #333333;
      display: inline-block;
       &:nth-of-type(1) {
        width:130px;
      }
      &:nth-of-type(2) {
        color:#666666;
      }
    }
  }
}
</style>